package com.back.campus_back.mapper;

import com.back.campus_back.domain.Collect;
import com.back.campus_back.domain.Goods;
import com.back.campus_back.domain.ShoppingCart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  ShoppingCartMapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2021-04-17
 */
@Mapper
@Repository // 代表持久层
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {

    //根据用户查询对应的购物车信息
    public List getShoppingCart(@Param(value = "user_id") int user_id);

    //  查询购物车的某一条商品信息
    public List<Goods> getShoppingCartOne(@Param(value = "user_id") int user_id,@Param(value = "goods_id") int goods_id);

    //个人添加商品到购物车
    public int addShoppingCart(@Param(value = "user_id") int user_id, @Param(value = "goods_id") int goods_id);

    //删除购物车的商品
    public int deleteShoppingCart(@Param(value = "user_id") int user_id, @Param(value = "goods_id") int goods_id);


}
